CMAKE_MINIMUM_REQUIRED(VERSION 3.22)
PROJECT(TankWar)

SET(CMAKE_CXX_STANDARD 20)
SET(CMAKE_BUILD_TYPE Debug)
SET(TARGET MoveTest)

# 添加包含头文件的目录, #include的时候可以用尖括号了~
INCLUDE_DIRECTORIES(
        ${PROJECT_SOURCE_DIR}/src/include
)
# 添加包含 CMakeLists.txt 和源文件的子目录
ADD_SUBDIRECTORY(
        ${PROJECT_SOURCE_DIR}/src
)

#把指定目录下所有源代码文件和头文件存入变量 ALL_SRC, 作生成target用,
AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR} ALL_SRC)
#AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR}/src ALL_SRC)

# 使用${ALL_SRC}中的文件生成可执行目标文件 ${TARGET}
ADD_EXECUTABLE(${TARGET} ${ALL_SRC})

TARGET_LINK_LIBRARIES(${TARGET} game_api)